import java.util.*;
import java.util.Map.Entry;

public class _02_SequencesOfEqualStrings {
	
	public static void main(String[] args) {
		
		Scanner inputCS = new Scanner(System.in);
		
		String input = inputCS.nextLine();
		
		inputCS.close();
		
		String[] words = input.split(" ");
		
		Map<String, Integer> wordsFrequencies = new HashMap<String, Integer>();
		
		for (String word : words) {
			
			Integer freq = wordsFrequencies.get(word);
			wordsFrequencies.put(word, (freq == null) ? 1 : freq + 1);
		}
		
		for (Entry<String, Integer> entry : wordsFrequencies.entrySet()) {
			
			String key = entry.getKey();
			int value = entry.getValue();
			
			for (int i = 0; i < value; i++) {
				
				System.out.print(key + " ");
			}
			
			System.out.println();
		}
	}
}